<?php
/*
+-----------------------------------------------------------------------------+
| $Id: *.php,v 1.* 2005/07/01 06:15:08 Bleakwind Exp $
| SnowStats
|         --- A Web Statistics Analysis for multiuser
| Copyright (c) 2003-2005 Weaverdream.com By Bleakwind
| http://www.weaverdream.com
+-----------------------------------------------------------------------------+
*/

include_once 'include/include.php';
check_adminlogin();
include_once 'include/header.php';
?>

<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#5E94DD" align="center">
  <tr bgcolor="#5E94DD">
    <td width="200" align="center" valign="top" class="left_bg">
      <?include_once 'include/menu.php';?>
	</td>
	<td width="560" bgcolor="#FFFFFF" valign="top">

<?php
if(empty($_GET['act'])){

$str      = "";
$forbidip = file($SETTING['file_forbidip']);
for($i=1;$i<count($forbidip);$i++){
    $str .= trim($forbidip[$i])."\n";
}
?>

<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['admin_forbidip_placedir'];?> &raquo; <?php echo $LANGUAGE['admin_forbidip_place'];?></td></tr></table>
<br>

<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<form action="admin_forbidip.php?act=save" method="post" name="form">
<tr><td>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
<tr bgcolor="#5E94DD"><td align="center" class="right_title"><?php echo $LANGUAGE['admin_forbidip_explain'];?></td></tr>
<tr bgcolor="#EBE9ED"><td align="center"><textarea name="blacklist" rows="20" cols="30" class="textarea"><?php echo $str;?></textarea>
</td></tr>
<tr bgcolor="#EBE9ED"><td colspan="3" align="center"><input type="submit" value="<?php echo $LANGUAGE['admin_forbidip_submit'];?>" class="submit"><input type="reset" value="<?php echo $LANGUAGE['admin_forbidip_reset'];?>" class="submit"></td></tr>
</table>

</td></tr></form></table>

<?php
}elseif($_GET['act'] == "save") {

$text  = "<?php exit(\"".$SETTING['cannotview']."\");?>\n".$_POST['blacklist'];

if(write_file($SETTING['file_forbidip'],$text)) {
      header("location:prompt.php?act=succeed&mes=".htmlentities(urlencode($LANGUAGE['admin_amend_succeed'])));
      exit;
}else{
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['admin_amend_failed'])));
      exit;
}

}

echo "<br></td></tr></table>";
include_once 'include/footer.php';
?>
